import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsDefined, IsNotEmpty } from "class-validator";

export class CreateleaveAMessageDto{
 
    @IsDefined({ message:'用户ID不能为空' })
    @IsNotEmpty({ message: 'id必填' })
    @ApiProperty({
        type:String,
        name:'userId',
        description:'用户ID',
    })
    public readonly userId:string

    @IsDefined({message:'留言内容不能为空'})
    @IsNotEmpty({message:'留言内容不能为空'})
    @ApiProperty({
        type:String,
        name:'content',
        description:'留言内容'
    })
    public readonly content:string

    @ApiPropertyOptional({
        type:String,
        name:'toUserId',
        description:'被回复用户id',
    })
    public toUserId?:string

    @ApiPropertyOptional({
        type:Number,
        name:'messageBoardId',
        description:'留言ID'
    })
    public messageBoardId?:number
}

export class MessageInfoDto {
    public id: number;
    public content: string;
    public toUserId: string;
    public messageBoardId: number;
    public userId:string;
  }
  
  export interface MessageRo {
    list: MessageInfoDto[];
    count: number;
  }
